import request from '@/utils/request'

// 部件属性

/**
 * 获取列表
 *
 * @export
 * @param {*} data { accountId, fixedAssets, keyword }
 * @returns
 */
export function fetchCarFindPage(data) {
  return request({
    url: '/pc/base/car/findPage',
    method: 'post',
    data
  })
}

/**
 * 获取详情
 *
 * @export
 * @param {*} params { id }
 * @returns
 */
export function fetchCarGet(params) {
  return request({
    url: '/pc/base/car/get',
    method: 'get',
    params
  })
}

/**
 * 添加
 *
 * @export
 * @param {*} data { accountIdStr, carNumbber, carType, brand, deviceIdStr, engineNo, insuranceCompany
                    insuranceExpireDate, orginType, ownership, powerType, price, productionDate, status, vin, weight }
 * @returns
 */
export function fetchCarAdd(data) {
  return request({
    url: '/pc/base/car/add',
    method: 'post',
    data
  })
}

/**
 * 更新
 *
 * @export
 * @param {*} data { id, accountIdStr, carNumbber, carType, brand, deviceIdStr, engineNo, insuranceCompany
                    insuranceExpireDate, orginType, ownership, powerType, price, productionDate, status, vin, weight }
 * @returns
 */
export function fetchCarUpdate(data) {
  return request({
    url: '/pc/base/car/update',
    method: 'post',
    data
  })
}

/**
 * 删除
 *
 * @export
 * @param {*} data { id }
 * @returns
 */
export function fetchCarDelete(params) {
  return request({
    url: '/pc/base/car/delete',
    method: 'post',
    params
  })
}

/**
 * 更新状态
 *
 * @export
 * @param {*} params { status, id }
 * @returns
 */
export function fetchCarStatusUpdate(params) {
  return request({
    url: '/pc/base/car/updateStatus',
    method: 'post',
    params
  })
}

/**
 * 导出
 *
 * @export
 * @param {*} params
 * @returns
 */
// export function fetchCarExport(params) {
//   return request({
//     url: '/pc/base/car/exportCar',
//     method: 'get',
//     params,
//     responseType: 'blob',
//     getResponse: true,
//     download: true,
//     onlyFile: true
//   })
// }
